﻿@page "/daily/operator";
@namespace YwhWeb.Pages.Daily

<div style="text-align: right;">

    <PageContainer Title="操作人员" Style="right">
        <Content>   
            <Button @onclick="_=>NewDrawer()">添加操作人员</Button> 
            
        </Content>

        
            <ChildContent>
            <Table @ref="table"
                   TItem="YwhLib.Operator"
                   DataSource="@operatorRsp.Items"
                   Total="_total"
                   @bind-PageIndex="_pageIndex"
                   @bind-PageSize="_pageSize"
                   @bind-SelectedRows="selectedRows"
                   OnChange="OnChange">
                <Selection Key="@(context.OperatorId.ToString())" />
                <AntDesign.Column Title="用户Id" @bind-Field="@context.OperatorId" Sortable />
                <AntDesign.Column Title="用户名" @bind-Field="@context.UserName" />
                <AntDesign.Column Title="密码" @bind-Field="@context.Password" />
                <AntDesign.Column Title="真实姓名" @bind-Field="@context.TrueName" />
                <AntDesign.Column Title="角色 admin管理员 secretary" @bind-Field="@context.Role" />
                <AntDesign.Column Title="添加时间" @bind-Field="@context.AddTime" Format="yyyy-MM-dd" Sortable />
            </Table>
            </ChildContent>
    </PageContainer>
</div>

<Drawer Visible="this.drawerVisible" Width="500" OnClose="a=>{this.drawerVisible=false;}">
      <Title Level="4">添加操作人员</Title>
    <div>
    <p ></p>
 </div>

 <Text>用户Id:</Text>
<div>
    <Input Placeholder="请输入用户Id" @bind-Value="@editOperator.OperatorId"  />
    <p></p>
</div>

<Text>用户名:</Text>
    <div>
    <Input Placeholder="请输入用户名" @bind-Value="@editOperator.UserName"  />
    <p></p>
</div>

<Text>密码:</Text>
<div>
    <Input Placeholder="请输入密码" @bind-Value="@editOperator.Password"  />
    <p></p>
</div>

<Text>真实姓名:</Text>
<div>
    <Input Placeholder="请输入真实姓名" @bind-Value="@editOperator.TrueName"  />
    <p></p>
</div>

<Text>角色 admin管理员 secretary:</Text>
<div>
    <Input Placeholder="请输入角色 admin管理员 secretary" @bind-Value="@editOperator.Role"  />
    <p></p>
</div>

<Text>添加时间:</Text>
    <div>
    <DatePicker TValue="DateTime" ShowTime="@true"
               DefaultValue=@editOperator.AddTime
               Format="yyyy-MM-dd HH:mm:ss"
               DisabledDate="date => date <= DateTime.Now"
               DisabledTime="date => GetDisabledTime(date)" 
               />
    <p></p>
</div>

<div style="text-align: right;">
    <Button Type="@ButtonType.Primary">保存</Button>
</div>

</Drawer>